// WorldServer Game.h

#ifndef GAME_H

#include "../Frame/TcpServer.h"
#include "../Frame/TcpClient.h"
#include "../Frame/Config.h"
#include "../Frame/Common.h"
#include "../Frame/Database.h"
#include "../Frame/GlobalManager.h"
#include "Mgr/PlayerManager.h"
#include "Mgr/RoleManager.h"
#include "MsgRounter.h"
#include "System/Login.h"



#include <iostream>
#include <thread>
#include <fstream>

#define GAME_H


class Game
{
private:
	Game();
	Game(const Game&);

    TcpServer m_ServerSock;
    TcpClient m_ClientSock;

	MsgRounter m_MsgRounter;

	Database  m_GameDb;


	Login m_Login;

	GlobalManager m_GlobalMgr; 								// 全局数据管理器

	PlayerManager m_PlayerMgr;

	RoleManager m_RoleMgr;


    bool m_isEixt;

public:

	~Game();

public:
	static Game& GetInstance()
	{
		static Game Instance;
		return Instance;
	}



	void Init();

	void Dispose();

	void Exit();

	void GameLoop();

	//void SendMsg2Client(Message* _pMsg);

	TcpServer* GetSock();

	TcpClient* GetSockClient();

	Login* GetLogin();

	GlobalManager* GetGobalMgr();

	PlayerManager* GetPlayerMgr();

	RoleManager* GetRoleMgr();

protected:


};

#endif // GAME_H
